#!/bin/bash

output=$1
width=$2
height=$3

echo "xrandr --newmode ${width}x${height}$( \
    cvt $width $height | tail -1 | \
    awk '{for(i=3;i<=NF;i++){printf " "$i}; printf "\n"}' \
) &&\\
    xrandr --addmode $output ${width}x${height} &&\\
    xrandr --output $output --mode ${width}x${height}
"
